import { createSlice } from "@reduxjs/toolkit";

//创建一个计数store
export const userStore = createSlice({
  name: "count",
  //vuex中的state
  initialState: {
    username: "admin",
    password: "1111",
  },
  //vuex中的mutations
  reducers: {
    setUsername: (state, action) => {
      state.username = action.payload;
    },
  },
});

export const { setUsername } = userStore.actions;

export default userStore.reducer;
